/*
 * application.c
 *
 *  Created on: May 23, 2021
 *      Author: kirk_
 */

#include "application.h"

#include "velocity.h"
#include "position.h"
#include "movement.h"
#include "direction.h"
#include "openmv.h"

void StartDefaultThread(void *argument)
{
	while(!osThreadFlagsWait(1, osFlagsWaitAll, 0x1FFF));
	osThreadFlagsClear(0xFFFF);

	osDelay(1000);
	/* Choose task */
	if(Switch_GPIO_Port->IDR & Switch_Pin)
		osThreadResume(Patio1TaskHandle);
	else
		osThreadResume(Patio2TaskHandle);

	/* Infinite loop */
	for(;;)
	{
		osDelay(1000);
	}
}
